package com.ruoyi.server.api.imgactivity.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.server.api.imgactivity.mapper.ImgActivityMapper;
import com.ruoyi.server.api.imgactivity.domain.ImgActivity;
import com.ruoyi.server.api.imgactivity.service.IImgActivityService;

/**
 * 活动图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class ImgActivityServiceImpl implements IImgActivityService 
{
    @Autowired
    private ImgActivityMapper imgActivityMapper;

    /**
     * 查询活动图片
     * 
     * @param id 活动图片主键
     * @return 活动图片
     */
    @Override
    public ImgActivity selectImgActivityById(Long id)
    {
        return imgActivityMapper.selectImgActivityById(id);
    }

    /**
     * 查询活动图片列表
     * 
     * @param imgActivity 活动图片
     * @return 活动图片
     */
    @Override
    public List<ImgActivity> selectImgActivityList(ImgActivity imgActivity)
    {
        return imgActivityMapper.selectImgActivityList(imgActivity);
    }

    /**
     * 新增活动图片
     * 
     * @param imgActivity 活动图片
     * @return 结果
     */
    @Override
    public int insertImgActivity(ImgActivity imgActivity)
    {
        imgActivity.setCreateTime(DateUtils.getNowDate());
        return imgActivityMapper.insertImgActivity(imgActivity);
    }

    /**
     * 修改活动图片
     * 
     * @param imgActivity 活动图片
     * @return 结果
     */
    @Override
    public int updateImgActivity(ImgActivity imgActivity)
    {
        imgActivity.setUpdateTime(DateUtils.getNowDate());
        return imgActivityMapper.updateImgActivity(imgActivity);
    }

    /**
     * 批量删除活动图片
     * 
     * @param ids 需要删除的活动图片主键
     * @return 结果
     */
    @Override
    public int deleteImgActivityByIds(Long[] ids)
    {
        return imgActivityMapper.deleteImgActivityByIds(ids);
    }

    /**
     * 删除活动图片信息
     * 
     * @param id 活动图片主键
     * @return 结果
     */
    @Override
    public int deleteImgActivityById(Long id)
    {
        return imgActivityMapper.deleteImgActivityById(id);
    }

    /**
    * @Author zsc
    * @Description 查询数据列表
    * @Date 2024/12/2 15:03
    * @Return java.util.List<com.ruoyi.server.api.imgactivity.domain.ImgActivity>

    */
    @Override
    public List<ImgActivity> ArticleLater(String searchQuery) {
        return imgActivityMapper.ArticleLater(searchQuery);
    }
}
